<template>
  <el-dialog
    ref="infodialog"
    title="项目信息变更"
    :visible.sync="isSeeInfo"
    width="66%"
    :before-close="handleClose"
    :close-on-press-escape="false"
    :close-on-click-modal="false"
    :destroy-on-close="true"
  >
    <!-- 1 项目基础信息 -->
    <el-form
      v-if="dialogItemObj"
      :model="dialogItemObj"
      label-width="160px"
      label-position="right"
      :rules="rules"
      ref="formRef"
    >
      <div v-if="changeType == 1">
        <el-form-item label="项目名称:" prop="projectName">
          <el-input
            v-model="dialogItemObj.projectName"
            placeholder="请输入项目名称"
          ></el-input>
        </el-form-item>
        <el-form-item label="申报类别:">
          <el-input
            v-model="dialogItemObj.projectType"
            placeholder="请输入项目申报类别"
          ></el-input>
        </el-form-item>
        <el-form-item label="申报单位:">
          <el-input
            v-model="dialogItemObj.projectUnit"
            placeholder="请输入申报单位"
          ></el-input>
        </el-form-item>
        <el-form-item label="项目负责人姓名:" prop="specialistInfo1">
          <el-input
            v-model="dialogItemObj.specialistInfo1"
            placeholder="请输入项目负责人姓名"
          ></el-input>
        </el-form-item>
        <el-form-item label="项目负责人职称:" prop="specialistInfo2">
          <el-input
            v-model="dialogItemObj.specialistInfo2"
            placeholder="请输入项目负责人职称"
          ></el-input>
        </el-form-item>
        <el-form-item label="通讯地址:">
          <el-input
            v-model="dialogItemObj.contractAddress1"
            placeholder="请输入通讯地址"
          ></el-input>
        </el-form-item>
        <el-form-item label="邮编:">
          <el-input
            v-model="dialogItemObj.contractAddress2"
            placeholder="请输入邮编"
          ></el-input>
        </el-form-item>
        <el-form-item label="手机号码:" prop="contractPhone1">
          <el-input
            v-model="dialogItemObj.contractPhone1"
            placeholder="请输入手机号码"
          ></el-input>
        </el-form-item>
        <el-form-item label="邮箱:" prop="contractPhone2">
          <el-input
            v-model="dialogItemObj.contractPhone2"
            placeholder="请输入邮箱"
          ></el-input>
        </el-form-item>
        <el-form-item label="合作单位:">
          <el-input
            v-model="dialogItemObj.cooperateUnit"
            placeholder="请输入合作单位"
          ></el-input>
        </el-form-item>
      </div>

      <el-form-item label="目的和意义:" v-if="changeType == 2" prop="purpose">
        <el-input
          type="textarea"
          v-model="dialogItemObj.purpose"
          placeholder="请输入目的和意义"
          autosize
        ></el-input>
      </el-form-item>

      <el-form-item label="实施基础与条件:" v-if="changeType == 3">
        <el-input
          type="textarea"
          v-model="dialogItemObj.base"
          placeholder="请输入实施基础与条件"
          autosize
        ></el-input>
      </el-form-item>

      <el-form-item label="实施内容:" v-if="changeType == 4" prop="content">
        <el-input
          type="textarea"
          v-model="dialogItemObj.content"
          placeholder="请输入实施内容"
          autosize
        ></el-input>
      </el-form-item>

      <el-form-item label="实施计划进度:" v-if="changeType == 5" prop="plan">
        <el-input
          type="textarea"
          v-model="dialogItemObj.plan"
          placeholder="请输入实施计划进度"
          autosize
        ></el-input>
      </el-form-item>

      <el-form-item
        label="主要技术指标及预期:"
        v-if="changeType == 6"
        prop="target"
      >
        <el-input
          type="textarea"
          v-model="dialogItemObj.target"
          placeholder="请输入主要技术指标及预期"
          autosize
        ></el-input>
      </el-form-item>

      <el-form-item label="实施人员:" v-if="changeType == 8">
        <el-table
          :data="dialogItemObj.user"
          border
          style="width: 100%; margin-top: 30px"
          :header-cell-style="{
            background: '#DDDDDD',
            color: '#333333',
          }"
        >
          <el-table-column label="本单位" align="left">
            <el-table-column label="#" width="50" align="center">
              <template slot-scope="scope">
                {{ scope.$index + 1 }}
              </template>
            </el-table-column>
            <el-table-column
              prop="userId"
              label="姓名"
              align="center"
              width="140"
            >
              <template slot-scope="scope">
                <el-select
                  v-model="scope.row.userId"
                  filterable
                  placeholder="请选择"
                  @change="changeUser(scope.row)"
                >
                  <el-option
                    v-for="item in peopleList"
                    :key="item.uid"
                    :label="item.name"
                    :value="item.uid"
                  >
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column
              prop="personAge"
              label="年龄"
              align="center"
              width="90"
            >
              <template slot-scope="scope">
                <el-input
                  v-model="scope.row.age"
                  type="number"
                  min="1"
                ></el-input> </template
            ></el-table-column>
            <el-table-column
              prop="personUnit"
              label="单位"
              align="center"
              width="180"
            >
              <template slot-scope="scope">
                <el-input v-model="scope.row.unit"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              prop="personZhiji"
              label="职务、职称"
              align="center"
              width="120"
            >
              <template slot-scope="scope">
                <el-input v-model="scope.row.dept"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              prop="personWork"
              label="在项目实施过程中拟承担的具体工作"
              align="center"
            >
              <template slot-scope="scope">
                <el-input
                  type="textarea"
                  autosize
                  v-model="scope.row.work"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="操作"
              width="240"
              align="center"
              fixed="right"
            >
              <template slot-scope="scope">
                <el-button
                  type="primary"
                  size="mini"
                  icon="el-icon-plus"
                  @click="addPeopleLine(scope.$index, 0)"
                ></el-button>
                <el-button
                  type="danger"
                  size="mini"
                  icon="el-icon-minus"
                  @click="delPeopleLine(scope.$index, 0)"
                ></el-button>
                <!-- 上移 -->
                <el-button
                  v-if="scope.$index > 0"
                  type="success"
                  size="mini"
                  icon="el-icon-top"
                  @click="moveUp(scope.$index, 0)"
                ></el-button>
                <!-- 下移 -->
                <el-button
                  v-if="scope.$index < dialogItemObjLen - 1"
                  type="warning"
                  size="mini"
                  icon="el-icon-bottom"
                  @click="moveDown(scope.$index, 0)"
                ></el-button>
              </template>
            </el-table-column>
          </el-table-column>
        </el-table>
        <el-table
          :data="dialogItemObj.otherPerson"
          :header-cell-style="{
            background: '#DDDDDD',
            color: '#333333',
          }"
        >
          <el-table-column label="外单位" align="left">
            <el-table-column label="序号" width="50" align="center">
              <template slot-scope="scope">
                {{ scope.$index + 1 }}
              </template>
            </el-table-column>
            <el-table-column label="姓名" align="center" width="140">
              <template slot-scope="scope">
                <el-input
                  v-model="scope.row.name"
                  placeholder="请输入"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column label="年龄" align="center" width="90">
              <template slot-scope="scope">
                <el-input
                  type="number"
                  min="1"
                  v-model="scope.row.age"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column label="单位" align="center" width="180">
              <template slot-scope="scope">
                <el-input
                  type="textarea"
                  autosize
                  v-model="scope.row.unit"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column label="职务、职称" align="center" width="120">
              <template slot-scope="scope">
                <el-input v-model="scope.row.dept"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="在项目实施过程中拟承担的具体工作"
              align="center"
            >
              <template slot-scope="scope">
                <el-input
                  type="textarea"
                  autosize
                  v-model="scope.row.work"
                ></el-input>
              </template>
            </el-table-column>
            <el-table-column
              width="240"
              label="操作"
              align="center"
              fixed="right"
            >
              <template slot-scope="scope">
                <el-button
                  type="primary"
                  size="mini"
                  icon="el-icon-plus"
                  @click="addPeopleLine(scope.$index, 1)"
                ></el-button>
                <el-button
                  type="danger"
                  size="mini"
                  icon="el-icon-minus"
                  @click="delPeopleLine(scope.$index, 1)"
                ></el-button>
                <!-- 上移 -->
                <el-button
                  v-if="scope.$index > 0"
                  type="success"
                  size="mini"
                  icon="el-icon-top"
                  @click="moveUp(scope.$index, 1)"
                ></el-button>
                <!-- 下移 -->

                <el-button
                  v-if="scope.$index < otherPersonLen - 1"
                  type="warning"
                  size="mini"
                  icon="el-icon-bottom"
                  @click="moveDown(scope.$index, 1)"
                ></el-button>
              </template>
            </el-table-column>
          </el-table-column>
        </el-table>
      </el-form-item>

      <el-form-item label="项目实施经费预算:" v-if="changeType == 9">
        <el-table
          :data="dialogItemObj.funds2"
          show-summary
          :summary-method="getSummaries"
          border
          style="width: 100%"
        >
          <el-table-column label="#" width="50" align="center">
            <template slot-scope="scope">
              {{ scope.row.fundsEnumKey }}
            </template>
          </el-table-column>
          <el-table-column label="预算支出科目" align="center">
            <template slot-scope="scope">
              {{ yusuanlist[scope.row.fundsEnumKey - 1] }}
            </template>
          </el-table-column>
          <el-table-column label="金额（万元）" align="center">
            <template slot-scope="scope">
              <el-input
                @input="inputVal(scope.row)"
                v-model="scope.row.fundsAmount"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="note" label="备注" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.note"></el-input>
            </template>
          </el-table-column>
        </el-table>
      </el-form-item>

      <el-form-item label="保障条件:" v-if="changeType == 10">
        1、实施地点及规模（涉及用地的项目，提供依法拥有基地的合法土地使用权。）
        <el-input
          type="textarea"
          v-model="dialogItemObj.conditionFirst"
          placeholder="请输入"
          autosize
        ></el-input>
      </el-form-item>
      <el-form-item label="" v-if="changeType == 10">
        2、组织方式、运行机制与保障措施（保证项目顺利落地实施的，产学研结合等）
        <el-input
          type="textarea"
          v-model="dialogItemObj.conditionSecond"
          placeholder="请输入"
          autosize
        ></el-input>
      </el-form-item>
    </el-form>

    <span slot="footer" class="dialog-footer">
      <el-button type="info" @click="handleClose">取 消</el-button>
      <el-button type="primary" @click="submitInfo('formRef')">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import {
  apiChangeProjectInfo,
  apiPeoList, // 10 获取人员列表
} from "@/api2/projectManagement/reporting";
export default {
  props: {
    projectId: {
      type: Number,
    },
    // 变更的信息
    changeType: {
      type: String,
    },
    isSeeInfo: {
      type: Boolean,
      default: () => false,
    },
    dialogItemObj: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    // 手机号
    const phoneRegex = /^1[3456789]\d{9}$/;
    // 电子邮箱
    const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
    return {
      dialogItemObjLen: 0,
      otherPersonLen: 0,
      peopleList: [],
      rules: {
        projectName: [
          { required: true, message: "请输入项目名称", trigger: "blur" },
        ],
        specialistInfo1: [
          {
            required: true,
            message: "请输入负责人姓名",
            trigger: "blur",
          },
        ],
        specialistInfo2: [
          {
            required: true,
            message: "请输入负责人职称",
            trigger: "blur",
          },
        ],
        contractPhone1: [
          {
            required: true,
            message: "请输入手机号",
            trigger: "blur",
          },
          {
            pattern: phoneRegex,
            message: "手机号格式输入错误",
            trigger: "blur",
          },
        ],
        contractPhone2: [
          {
            required: true,
            message: "请输入电子邮箱",
            trigger: "blur",
          },
          {
            pattern: emailPattern,
            message: "电子邮箱格式输入错误",
            trigger: "blur",
          },
        ],
        purpose: [
          { required: true, message: "请输入目的和意义", trigger: "blur" },
        ],
        purpose: [
          { required: true, message: "请输入目的和意义", trigger: "blur" },
        ],
        content: [
          {
            required: true,
            message: "请输入实施内容",
            trigger: "blur",
          },
        ],
        plan: [
          {
            required: true,
            message: "请输入实施计划进度",
            trigger: "blur",
          },
        ],
        target: [
          {
            required: true,
            message: "请输入主要技术指标及预期",
            trigger: "blur",
          },
        ],
      },
      yusuanlist: [
        "咨询费",
        "差旅费",
        "培训/会议费",
        "劳务费",
        "专用设备购置费",
        "专用材料购置费",
        "图书文献数据费",
        "出版/文献/信息传播/知识产权事务费",
        "其他支出",
        "咨询费",
        "差旅费",
        "培训/会议费",
        "劳务费",
        "专用设备购置费",
        "专用材料购置费",
        "图书文献数据费",
        "出版/文献/信息传播/知识产权事务费",
        "其他支出",
      ],
    };
  },
  mounted() {
    this.getPeoList();
  },
  methods: {
    // 上移
    moveUp(index, type) {
      // 本单位
      if (type == 0) {
        const temp = this.dialogItemObj.user[index]; // 记录当前项
        this.dialogItemObj.user.splice(index, 1); // 移除当前项
        this.dialogItemObj.user.splice(index - 1, 0, temp); // 在前一项插入当前项
      } else {
        // 外单位
        const temp = this.dialogItemObj.otherPerson[index];
        this.dialogItemObj.otherPerson.splice(index, 1);
        this.dialogItemObj.otherPerson.splice(index - 1, 0, temp);
      }
    },
    // 下移
    moveDown(index, type) {
      if (type == 0) {
        const temp = this.dialogItemObj.user[index];
        this.dialogItemObj.user.splice(index, 1);
        this.dialogItemObj.user.splice(index + 1, 0, temp);
      } else {
        const temp = this.dialogItemObj.otherPerson[index];
        this.dialogItemObj.otherPerson.splice(index, 1);
        this.dialogItemObj.otherPerson.splice(index + 1, 0, temp);
      }
    },
    inputVal() {
      this.getSummaries(this.dialogItemObj.funds2);
    },
    // 计算合计
    getSummaries(param) {
      let data;
      if (param instanceof Array) {
        data = param;
      } else {
        data = param.data;
      }

      const sums = [];
      data.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "总计";
          return;
        }
        const values = data.map((item) => Number(item.fundsAmount));

        if (index == 2) {
          sums[index] = values.reduce((prev, curr) => {
            const value = Number(curr);
            if (!isNaN(value)) {
              return prev + curr;
            } else {
              return prev;
            }
          }, 0);
          sums[index] += "万元";
        } else {
          sums[index] = "";
        }
      });
      return sums;
    },
    // 选择实施人员，自动获取单位、年龄、职称.现在没有单位、年龄，职称可能没有
    changeUser(row) {
      let userInfoObj = {};
      for (let i = 0; i < this.peopleList.length; i++) {
        if (row.userId == this.peopleList[i].uid) {
          userInfoObj = this.peopleList[i];
        }
      }
      row.age = 0; //年龄
      row.unit = ""; //单位
      row.dept = userInfoObj.zhiji ?? ""; //职称
    },
    // 获取负责人
    getPeoList() {
      apiPeoList()
        .then((res) => {
          if (res.code == 0) {
            this.peopleList = res.data;
          } else {
            this.peopleList = [];
          }
        })
        .catch((err) => {
          console.log(err);
          this.peopleList = [];
        });
    },
    // 添加、删除实施人员
    addPeopleLine(idx, type) {
      if (type == 0) {
        let myObject = {
          index: idx + 1,
          sort: idx + 1,
          userId: "", //人员id
          name: "", //姓名 personUnit
          personAge: 0, //实施人员年龄
          personUnit: "", //	实施人员单位
          personWork: "", //实施人员承担的具体工作,
          personZhiji: "", //	实施人员职级
          age: 0,
          userId: "",
          dept: "", //职务
          unit: "", //	单位
          work: "", // 担任工作
          // 注意：传的数据有所不同
        };
        this.dialogItemObj.user.splice(idx + 1, 0, myObject);
        for (let i = 0; i < this.dialogItemObj.user.length; i++) {
          this.dialogItemObj.user[i].index = i;
          this.dialogItemObj.user[i].sort = i;
        }
        this.dialogItemObjLen = this.dialogItemObj.user.length;
        this.$forceUpdate();
      } else {
        let row = this.dialogItemObj.otherPerson[idx];
        if (!row.name || !row.age || !row.unit || !row.dept || !row.work) {
          this.msgError("请将信息完善后添加");
          return;
        }

        let myObject = {
          name: "",
          age: 0,
          dept: "",
          unit: "",
          work: "",
          personAge: 0,
          personUnit: "",
          personWork: "",
          personZhiji: "",
        };
        this.dialogItemObj.otherPerson.splice(idx + 1, 0, myObject);
        for (let i = 0; i < this.dialogItemObj.otherPerson.length; i++) {
          this.dialogItemObj.otherPerson[i].sort = i;
        }
        this.otherPersonLen = this.dialogItemObj.otherPerson.length;
        this.$forceUpdate();
      }
    },
    delPeopleLine(idx, type) {
      if (type == 0) {
        this.dialogItemObj.user.splice(idx, 1);
        for (let i = 0; i < this.dialogItemObj.user.length; i++) {
          this.dialogItemObj.user[i].index = i;
          this.dialogItemObj.user[i].sort = i;
        }
        this.dialogItemObjLen -= 1;
        this.$forceUpdate();
      } else {
        this.dialogItemObj.otherPerson.splice(idx, 1);
        for (let i = 0; i < this.dialogItemObj.otherPerson.length; i++) {
          this.dialogItemObj.otherPerson[i].index = i;
          this.dialogItemObj.otherPerson[i].sort = i;
        }
        this.otherPersonLen -= 1;
        this.$forceUpdate();
      }
    },
    // 删除添加的信息
    delKaoHe(idx) {
      this.dialogItemObj.targets.splice(idx, 1);
      for (let i = 0; i < this.dialogItemObj.targets.length; i++) {
        this.dialogItemObj.targets[i].index = i;
        this.dialogItemObj.targets[i].sort = i;
      }
    },

    // 添加考核信息
    addKaoHe(idx) {
      let myObject = {
        index: idx + 1,
        sort: idx + 1,
        unitName: "",
        name: "",
        yusuan: 0,
        zichou: 0,
      };
      this.dialogItemObj.targets.splice(idx + 1, 0, myObject);
      for (let i = 0; i < this.dialogItemObj.targets.length; i++) {
        this.dialogItemObj.targets[i].index = i;
        this.dialogItemObj.targets[i].sort = i;
      }
    },

    // 确 定
    submitInfo(formName1) {
      this.$refs[formName1].validate((valid) => {
        if (valid) {
          const content = {
            purpose: this.dialogItemObj.purpose,
            base: this.dialogItemObj.base,
            content: this.dialogItemObj.content,
            plan: this.dialogItemObj.plan,
            target: this.dialogItemObj.target,
            targets: this.dialogItemObj.targets,
            conditionFirst: this.dialogItemObj.conditionFirst,
            conditionSecond: this.dialogItemObj.conditionSecond,
          };

          // 内部人员
          let user = this.dialogItemObj.user;
          if (!user.length) {
            user = [];
          } else {
            for (let i = 0; i < user.length; i++) {
              if (
                !user[i].userId ||
                !user[i].age ||
                !user[i].unit ||
                !user[i].dept ||
                !user[i].work
              ) {
                if (this.changeType == 8) {
                  this.msgError("内部实施人员信息填写有误");
                  return;
                } else {
                  user = [];
                }
              }
            }
          }
          // 人员其余参数
          for (let i = 0; i < user.length; i++) {
            user[i].personAge = user[i].age;
            user[i].personUnit = user[i].unit;
            user[i].personWork = user[i].work;
            user[i].personZhiji = user[i].dept;
            user[i].sort = i + 1;
          }

          // 外部人员
          let otherPerson = this.dialogItemObj.otherPerson;
          if (!otherPerson.length) {
            otherPerson = [];
          } else {
            if (otherPerson.length == 1) {
              for (let i = 0; i < otherPerson.length; i++) {
                if (
                  otherPerson[i].age == "" ||
                  otherPerson[i].dept == "" ||
                  otherPerson[i].unit == "" ||
                  otherPerson[i].work == "" ||
                  otherPerson[i].name == ""
                ) {
                  if (this.changeType == 8) {
                    this.msgError("外部实施人员信息填写有误");
                    return;
                  } else {
                    otherPerson = [];
                  }
                }
              }
            } else {
              for (let i = 0; i < otherPerson.length; i++) {
                if (
                  otherPerson[i].age == "" ||
                  otherPerson[i].dept == "" ||
                  otherPerson[i].unit == "" ||
                  otherPerson[i].work == "" ||
                  otherPerson[i].name == ""
                ) {
                  this.msgError("外部实施人员信息填写有误");
                  return;
                }
              }
            }
          }
          // 外部人员
          for (let i = 0; i < otherPerson.length; i++) {
            otherPerson[i].personAge = otherPerson[i].age;

            otherPerson[i].personUnit = otherPerson[i].unit;

            otherPerson[i].personWork = otherPerson[i].work;

            otherPerson[i].personZhiji = otherPerson[i].dept;

            otherPerson[i].sort = i + 1;
          }

          // 经费其余参数
          for (let j = 0; j < this.dialogItemObj.funds.length; j++) {
            this.dialogItemObj.funds[j].amount = this.dialogItemObj.funds[
              j
            ].fundsAmount = Number(this.dialogItemObj.funds[j].fundsAmount);
          }
          for (let j = 0; j < this.dialogItemObj.funds2.length; j++) {
            this.dialogItemObj.funds2[j].amount = this.dialogItemObj.funds2[
              j
            ].fundsAmount = Number(this.dialogItemObj.funds2[j].fundsAmount);
          }

          let data = {
            content: content,
            projectName: this.dialogItemObj.projectName,
            projectType: this.dialogItemObj.projectType,
            projectUnit: this.dialogItemObj.projectUnit,
            specialistInfo:
              this.dialogItemObj.specialistInfo1 +
              "," +
              this.dialogItemObj.specialistInfo2,
            contractAddress:
              this.dialogItemObj.contractAddress1 +
              "," +
              this.dialogItemObj.contractAddress2,
            contractPhone:
              this.dialogItemObj.contractPhone1 +
              "," +
              this.dialogItemObj.contractPhone2,
            cooperateUnit: this.dialogItemObj.cooperateUnit,
            projectCategory: 1,
            // 人员
            xmProjectPersonList: user,
            // 外部人员
            xmProjectOtherPersonList: otherPerson,
            // 经费
            xmProjectFundsList: this.dialogItemObj.funds2,
            // 申报书地址
            appendixUrl: JSON.stringify(this.dialogItemObj.appendixUrl),
            xmProjectAppendix: {
              // 项目合同
              contractAppendixUrl: JSON.stringify(
                this.dialogItemObj.xmProjectAppendix.contractAppendixUrl
              ),
              // 立项文件
              setUpAppendixUrl: JSON.stringify(
                this.dialogItemObj.xmProjectAppendix.setUpAppendixUrl
              ),
              // 项目实施计划
              projectExecutionAppendixUrl: JSON.stringify(
                this.dialogItemObj.xmProjectAppendix.projectExecutionAppendixUrl
              ),
              // 通知文件
              noticeAppendixUrl: JSON.stringify(
                this.dialogItemObj.xmProjectAppendix.noticeAppendixUrl
              ),
              // 其他
              otherAppendixUrl: JSON.stringify(
                this.dialogItemObj.xmProjectAppendix.otherAppendixUrl
              ),
              // 预算经费附件
              fundsAppendixUrl: JSON.stringify(
                this.dialogItemObj.xmProjectAppendix.fundsAppendixUrl
              ),
            },
            // 实施阶段
            xmProjectPeriodList: this.dialogItemObj.xmProjectPeriodList,
          };

          let params = {
            data: JSON.stringify(data),
            projectId: this.projectId,
          };

          apiChangeProjectInfo(params)
            .then((res) => {
              if (res.code == 0) {
                this.msgSuccess("提交成功");
                this.handleClose();
              } else {
                this.msgError("提交失败");
              }
            })
            .catch((err) => {
              console.log(err);
              this.msgError("提交失败");
            });
        } else {
          return false;
        }
      });
    },
    handleClose() {
      this.$emit("handleCloseFn", false);
    },
  },
};
</script>

<style></style>
